﻿<!DOCTYPE html>
<html>
	<meta charset="UTF-8"/>
	<head>
		<script>
			function test(){
				var w = weight.value; //体重
				var h = height.value; //身高
				var sw = (h-108)*2;//标准体重
				
				if(w - sw > 10) {
					console.log("体重超标");
				} else if(w - sw < -10) {
					console.log("体重过轻");
				} else {
					console.log("体重标准");
				}
			}
			
		</script>
	</head>
	<body>
		<p>
		体重:<input id="weight" type="text"/>
		</p>
		<p>
		身高:<input id="height" type="text" />
		</p>
		<p>
			<button onclick="test()">计算</button>
		</p>
	</body>	
</html>











